﻿/// <reference path="~/Scripts/app/model.js" />

/**
 @title:        model.workspace
 @description:  Model for general workspace view. Will be substituted in future to more specific model.
 @author:       Yuriy Shapovalov (shapovalov.yuri@gmail.com)
 */

define('model.mapper',
    ['model'],
    function (model) {
        var workspace = {
            /**
             @description: Returns id of DTO object
            */
            getDtoId: function (dto) { return dto.id; },
            /**
             @description: Build new model according to received data
            */
            fromDto: function (dto, item) {
                debugger // check that dto object is correct and contain all required data, before creating of Workspace object
                item = item || new model.Workspace().id(dto.id);
                return item;
            }
        },
        activities = {
            getDtoId: function (dto) { return dto.id; },
            fromDto: function (dto, item) {
                item = item || new model.A
            }
        };

        return {
            workspace: workspace,
            activities: activities
        };
    });